//
//  AppleSignManager.h
//  WXReader
//
//  Created by Chair on 2020/1/27.
//  Copyright © 2020 Andrew. All rights reserved.
//

#import <Foundation/Foundation.h>

@class TL_UserInfoModel;

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSUInteger, TL_appleSignState) {
    TL_AppleSignStateLogin,
    TL_AppleSignStateBinding
};

@protocol TL_AppleSignManagerDelegate <NSObject>

@optional
- (void)appleSignResponseSuccess:(TL_UserInfoModel *)userData;

- (void)appleSignResponseFail:(NSString *)error;

@end

@interface TL_AppleSignManager : NSObject

@property (nonatomic, weak) id <TL_AppleSignManagerDelegate> delegate;

/// 登录成功
@property (nonatomic, copy) void(^ _Nullable appleLoginSuccess)(TL_UserInfoModel *, TL_AppleSignManager *);

/// 登录失败
@property (nonatomic, copy) void(^ _Nullable appleLoginError)(NSString *, TL_AppleSignManager *);

SINGLETON_INTERFACE

- (void)tunedUpAppleSignWithState:(TL_appleSignState)state API_AVAILABLE(ios(13.0));

@end

NS_ASSUME_NONNULL_END
